* location: products, plans, churn variables
clear 
set more off

* use more recent data 
use OrigData/InvoiceData/frmp_data_20130821_clean, clear
rename customer_number account_number

sort account_number

duplicates tag account_number, gen(dup)

drop if  accnt_status_code=="CLOSED" & dup>0
*185 observations deleted
drop dup
duplicates list account_number

* Distributor codes from site identifiers
gen distributor=substr(site_identifier,1,3)
destring distributor, force replace
label define distributorvals 600 "Jemena" 610 "Citipower" 620 "Powercor" 630 "SPAusNet" 640 "United"
label values distributor distributorvals

save Data/location, replace


